﻿using Ping9719.WpfEx.Mvvm;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BaseUi.ViewModel
{
    public class UserInfoViewModel : BindableBase
    {
        private bool isLogin = false;
        /// <summary>
        /// 是否登录
        /// </summary>
        public bool IsLogin { get => isLogin; set { SetProperty(ref isLogin, value); } }

        private string LoginName_;
        /// <summary>
        /// 登录名
        /// </summary>
        public string LoginName { get => LoginName_; set { SetProperty(ref LoginName_, value); } }

        private object Auth_;
        /// <summary>
        /// 权限变化通知
        /// </summary>
        public object Auth { get => Auth_; set { SetProperty(ref Auth_, value); } }

        private UserBase User_;
        /// <summary>
        /// 用户
        /// </summary>
        public UserBase User { get => User_; set { SetProperty(ref User_, value); LoginName = value?.LoginName ?? null; } }

        private List<RoleBase> Roles_;
        /// <summary>
        /// 角色
        /// </summary>
        public List<RoleBase> Roles { get => Roles_; set { SetProperty(ref Roles_, value); Auth = new object(); } }

    }
}
